﻿using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using dbutility;
using DBUtility;
using System.Collections.Generic;

namespace hf.DAL
{
    public class EnglishKeyDAL
    {

        public List<hf.Model.EnglishKeyModel> GetKeyList(int PageSize, int PageNumber, string strWhere, out int total)
        {
            DataSet ds = PageHelper.GetList(PageSize, PageNumber, "tb_EnglishKey", "EngKey", "", out total);

            //实例化列表
            List<hf.Model.EnglishKeyModel> list = new List<hf.Model.EnglishKeyModel>();

            //判断ds是不是空的
            if (ds.Tables[0].Rows.Count > 0)
            {
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    //把datatable转换成对象
                    hf.Model.EnglishKeyModel m = DBHelperSQL.SetModel<hf.Model.EnglishKeyModel>(dr);

                    if (m != null)
                        list.Add(m);
                }
            }

            return list;
        }
    }
}
